package testes;


import static org.junit.Assert.*;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import excessoes.ArrayIncompativel;
import excessoes.CorNaoExiste;
import excessoes.CorRepetida;

import rodadas.Tentativa;

public class TentativaTestEquivalencia {
	private Tentativa tentativa;

	@Before
	public void setUp() throws Exception {
		tentativa = new Tentativa();
	}

	@After
	public void tearDown() throws Exception {
		tentativa = null;
	}
	
	@Test
	public void setTentativaCerta() throws Exception{
		int[] aux = {1,2,3,4};
		tentativa.setTentativa(aux);
		assertEquals(aux,tentativa.getTentativa());
 	}
	
	@Test(expected=CorNaoExiste.class)
	public void setTentativaErradaCor() throws Exception{
		int[] aux = {10,8,11,12};
		tentativa.setTentativa(aux);
	}
	
	@Test(expected=ArrayIncompativel.class)
	public void setTentativaErradaTamanho() throws Exception{
		int[] aux = {1,2,3,4,5};
		tentativa.setTentativa(aux);
	}
	
	@Test(expected=CorRepetida.class)
	public void setTentativaErradaRepetida() throws Exception{
		int[] aux = {1,1,1,1};
		tentativa.setTentativa(aux);
	}

}
